package wang.hu.bos.service.transit.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import wang.hu.bos.dao.transit.DeliveryInfoDao;
import wang.hu.bos.dao.transit.TransitDao;
import wang.hu.bos.domain.transit.DeliveryInfo;
import wang.hu.bos.domain.transit.TransitInfo;
import wang.hu.bos.service.transit.DeliveryInfoService;

@Service
@Transactional
public class DeliveryInfoServiceImpl implements DeliveryInfoService {
	@Autowired
	private DeliveryInfoDao deliveryInfoDao;
	@Autowired
	private TransitDao transitDao;

	@Override
	public void save(String transitInfoid, DeliveryInfo deliveryInfo) {
		deliveryInfoDao.save(deliveryInfo);
		TransitInfo transitInfo = transitDao.findOne(Integer
				.parseInt(transitInfoid));
		transitInfo.setDeliveryInfo(deliveryInfo);
		transitInfo.setStatus("开始配送");

	}

}
